//
//  RexelHelpers.h
//  Rexel
//
//  Created by Zach Zahos on 2014-05-19.
//  Copyright (c) 2014 Zach Zahos. All rights reserved.
//

#ifndef __Rexel__RexelHelpers__
#define __Rexel__RexelHelpers__

#include "Rexel.h"



typedef struct {
	char *validPrefixes, *validCharacters;
	unsigned long prefixes, characters;
} RXLTypeDefCharactersSettings;

RXLValidity RXLTypeDefCharacters(const char *buffer, unsigned long index, void *settings, void **context);



typedef struct {
	char *prefix, *suffix;
	unsigned long prefixLength, suffixLength;
	RXLBool multiline;
} RXLTypeDefStringQuoteSettings;
typedef struct {
	RXLTypeDefStringQuoteSettings **quoteSettings;
	unsigned long quotes;
	char escapeCharacter;
} RXLTypeDefStringSettings;

RXLValidity RXLTypeDefString(const char *buffer, unsigned long index, void *settings, void **context);



typedef struct {
	char base;
	char *validDigits;
	unsigned long digits;
	RXLBool allowDecimal, allowExponent;
} RXLTypeDefNumberBaseSettings;

typedef struct {
	RXLBool allowPositive, allowNegative;
	RXLTypeDefNumberBaseSettings **validBases;
	unsigned long bases;
} RXLTypeDefNumberSettings;

RXLValidity RXLTypeDefNumber(const char *buffer, unsigned long index, void *settings, void **context);



#endif /* defined(__Rexel__RexelHelpers__) */
